package com.funcity.stage.layers
{
	import com.funcity.stage.elements.StageMasker;
	
	import flash.display.Sprite;
	
	public final class StageLayer extends Sprite
	{
		private var _maskers:Vector.<StageMasker> = new Vector.<StageMasker>();
		
		public function StageLayer()
		{
			super();
			
			mouseChildren = false;
			mouseEnabled = false;
		}
		
		public function set maskers(list:Array):void
		{
			while (_maskers.length != 0)
			{
				removeChild(_maskers.pop());
			}
			
			for each (var entry:Object in list)
			{
				var masker:StageMasker = new StageMasker("map/" + entry.url, entry.x, entry.y);
				_maskers.push(masker);
				addChild(masker);
			}
		}
	}
}